package com.llc.spring.cloud.sdk.core.proxy;


import com.llc.spring.cloud.sdk.core.http.AbstractHttpClient;

import java.util.List;

/**
 * time 2018/8/27 14:32
 *
 * @author xiaojie.zhu <br>
 */
public class MethodDesc {

    private boolean get;

    private String path;

    private String name;

    private AbstractHttpClient.RequestType requestType;

    private List<ParamDesc> paramDescs;

    //带有@RequestBody注解的参数的位置
    private int postBodyIndex;

    private Class<?> returnType;

    public int getPostBodyIndex() {
        return postBodyIndex;
    }

    public void setPostBodyIndex(int postBodyIndex) {
        this.postBodyIndex = postBodyIndex;
    }

    public Class<?> getReturnType() {
        return returnType;
    }

    public void setReturnType(Class<?> returnType) {
        this.returnType = returnType;
    }

    public boolean isGet() {
        return get;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setGet(boolean get) {
        this.get = get;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public AbstractHttpClient.RequestType getRequestType() {
        return requestType;
    }

    public void setRequestType(AbstractHttpClient.RequestType requestType) {
        this.requestType = requestType;
    }

    public List<ParamDesc> getParamDescs() {
        return paramDescs;
    }

    public void setParamDescs(List<ParamDesc> paramDescs) {
        this.paramDescs = paramDescs;
    }

    @Override
    public String toString() {
        return "MethodDesc{" +
                "get=" + get +
                ", path='" + path + '\'' +
                ", requestType=" + requestType +
                ", paramDescs=" + paramDescs +
                '}';
    }
}
